﻿

namespace Xc.DataAccess.Core
{
    /// <summary>
    /// 带单位的字符串
    /// </summary>
    public class UnitString
    {
        /// <summary>
        /// 值
        /// </summary>
        public string Value { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        public static implicit operator string(UnitString unitString)
        {
            return unitString.ToString();
        }
        public override string ToString()
        {
            if (string.IsNullOrEmpty(Unit))
            {
                return Value;
            }
            return Value + " " + Unit;
        }
    }
}
